Optimal. Leaf size=91 \[ \frac {\tanh ^{-1}(\sin (c+d x))}{b^2 d}+\frac {a \tanh ^{-1}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 \sqrt {a^2+b^2} d}-\frac {\sec (c+d x)}{b d (a+b \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 132, normalized size of antiderivative = 1.45, number of steps
used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3593, 747, 858,
221, 739, 212} \begin {gather*} \frac {a \sec (c+d x) \tanh ^{-1}\left (\frac {b-a \tan (c+d x)}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right )}{b^2 d \sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}-\frac {\sec (c+d x)}{b d (a+b \tan (c+d x))}+\frac {\sec (c+d x) \sinh ^{-1}(\tan (c+d x))}{b^2 d \sqrt {\sec ^2(c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 221
Rule 739
Rule 747
Rule 858
Rule 3593
Rubi steps
\begin {align*} \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^2} \, dx &=\frac {\sec (c+d x) \text {Subst}\left (\int \frac {\sqrt {1+\frac {x^2}{b^2}}}{(a+x)^2} \, dx,x,b \tan (c+d x)\right )}{b d \sqrt {\sec ^2(c+d x)}}\\ &=-\frac {\sec (c+d x)}{b d (a+b \tan (c+d x))}+\frac {\sec (c+d x) \text {Subst}\left (\int \frac {x}{(a+x) \sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{b^3 d \sqrt {\sec ^2(c+d x)}}\\ &=-\frac {\sec (c+d x)}{b d (a+b \tan (c+d x))}+\frac {\sec (c+d x) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{b^3 d \sqrt {\sec ^2(c+d x)}}-\frac {(a \sec (c+d x)) \text {Subst}\left (\int \frac {1}{(a+x) \sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{b^3 d \sqrt {\sec ^2(c+d x)}}\\ &=\frac {\sinh ^{-1}(\tan (c+d x)) \sec (c+d x)}{b^2 d \sqrt {\sec ^2(c+d x)}}-\frac {\sec (c+d x)}{b d (a+b \tan (c+d x))}+\frac {(a \sec (c+d x)) \text {Subst}\left (\int \frac {1}{1+\frac {a^2}{b^2}-x^2} \, dx,x,\frac {1-\frac {a \tan (c+d x)}{b}}{\sqrt {\sec ^2(c+d x)}}\right )}{b^3 d \sqrt {\sec ^2(c+d x)}}\\ &=\frac {\sinh ^{-1}(\tan (c+d x)) \sec (c+d x)}{b^2 d \sqrt {\sec ^2(c+d x)}}+\frac {a \tanh ^{-1}\left (\frac {b \left (1-\frac {a \tan (c+d x)}{b}\right )}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right ) \sec (c+d x)}{b^2 \sqrt {a^2+b^2} d \sqrt {\sec ^2(c+d x)}}-\frac {\sec (c+d x)}{b d (a+b \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.88, size = 120, normalized size = 1.32 \begin {gather*} -\frac {\frac {2 a \tanh ^{-1}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {b \sec (c+d x)}{a+b \tan (c+d x)}}{b^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.40, size = 135, normalized size = 1.48
method | result | size |
derivativedivides | \(\frac {\frac {\frac {2 \left (\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}+b \right )}{a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-\frac {2 a \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}}{b^{2}}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}}{d}\) | \(135\) |
default | \(\frac {\frac {\frac {2 \left (\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}+b \right )}{a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-\frac {2 a \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}}{b^{2}}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}}{d}\) | \(135\) |
risch | \(-\frac {2 \,{\mathrm e}^{i \left (d x +c \right )}}{d b \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+a \,{\mathrm e}^{2 i \left (d x +c \right )}+i b +a \right )}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}\, d \,b^{2}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}\, d \,b^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d \,b^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d \,b^{2}}\) | \(186\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 212 vs.
\(2 (87) = 174\).
time = 0.50, size = 212, normalized size = 2.33 \begin {gather*} -\frac {\frac {2 \, {\left (a + \frac {b \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}}{a^{2} b + \frac {2 \, a b^{2} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {a^{2} b \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} - \frac {a \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} b^{2}} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{2}} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{2}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 293 vs.
\(2 (87) = 174\).
time = 0.45, size = 293, normalized size = 3.22 \begin {gather*} -\frac {2 \, a^{2} b + 2 \, b^{3} - {\left (a^{2} \cos \left (d x + c\right ) + a b \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - {\left ({\left (a^{3} + a b^{2}\right )} \cos \left (d x + c\right ) + {\left (a^{2} b + b^{3}\right )} \sin \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left ({\left (a^{3} + a b^{2}\right )} \cos \left (d x + c\right ) + {\left (a^{2} b + b^{3}\right )} \sin \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, {\left ({\left (a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{2} b^{3} + b^{5}\right )} d \sin \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{3}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.61, size = 166, normalized size = 1.82 \begin {gather*} \frac {\frac {a \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} b^{2}} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{2}} - \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{2}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )} a b}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.19, size = 383, normalized size = 4.21 \begin {gather*} -\frac {b^2\,\sin \left (c+d\,x\right )-\frac {2\,\left (a^2\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {a^2+b^2}+a^3\,\mathrm {atan}\left (\frac {1{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+1{}\mathrm {i}\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+2{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}+2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}\right )\,\cos \left (c+d\,x\right )\,1{}\mathrm {i}\right )}{\sqrt {a^2+b^2}}+\frac {2\,b\,\left (\frac {a\,\sqrt {a^2+b^2}}{2}+\frac {a\,\cos \left (c+d\,x\right )\,\sqrt {a^2+b^2}}{2}-a\,\sin \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {a^2+b^2}-a^2\,\mathrm {atan}\left (\frac {1{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+1{}\mathrm {i}\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+2{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}+2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}\right )\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}\right )}{\sqrt {a^2+b^2}}}{a\,b^2\,d\,\left (a\,\cos \left (c+d\,x\right )+b\,\sin \left (c+d\,x\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________